package com.javase.A02;

import java.util.Scanner;

public class A2_1库房出入货物程序设计 {
    public static void main(String[] args) {

        A2_1库房出入货物程序设计 t=new A2_1库房出入货物程序设计();
        Scanner scanner = new Scanner(System.in);

        System.out.println("请输入华为手机的库存");
        int a = scanner.nextInt();
        PhoneEntity huawei = t.setInfo("华为", "5.5", 3688.8, "8+1288全面刘海屏", a);

        System.out.println("请输入小米手机的库存");
        int b = scanner.nextInt();
        PhoneEntity xiaomi = t.setInfo("小米", "5.0", 2988.8, "4+64g全面屏", b);
        System.out.println("信息录入成功");

        //输出
        System.out.println("品牌型号-----尺寸-----价格-----配置-----库存数量-----总价");
        System.out.println(huawei.getBrand()+"-----"+huawei.getSize()+"-----"+huawei.getValue()+"-----"+
                huawei.getConfigure()+"-----"+huawei.getStock()+"-----"+huawei.getTotalPrice());
        System.out.println(xiaomi.getBrand()+"-----"+xiaomi.getSize()+"-----"+xiaomi.getValue()+"-----"+
                xiaomi.getConfigure()+"-----"+xiaomi.getStock()+"-----"+xiaomi.getTotalPrice());

        int totalNumble = huawei.getStock() + xiaomi.getStock();
        System.out.println("总库存："+totalNumble);

        double AllValue = huawei.getTotalPrice() + xiaomi.getTotalPrice();
        System.out.println("库存总价值："+AllValue);
    }

    public PhoneEntity setInfo(String b,String s,double v,String c,int st){
        double totalPrice=v*st;
        PhoneEntity pe = new PhoneEntity(b,s,v,c,st,totalPrice);
        return pe;
    }
}
